package com.zprmb.udzt;

import java.text.DecimalFormat;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.zprmb.udzt.ll.BaseHelper;

public class Addmoneyfail extends BaseActivity implements OnClickListener {
	private TextView tv_addmonry;
	private Button btn_again;
	private TextView my_assets, my_zhanghu;
	private ImageView img_back;
	private RelativeLayout rl_back;
	private TextView tv_customer;
	DecimalFormat df = new DecimalFormat("###0.00");

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.add_fail);
		BbtApplication.getInstance().addActvity(this);
		tv_addmonry = (TextView) findViewById(R.id.add_money);
		img_back = (ImageView) findViewById(R.id.img_back);
		my_zhanghu = (TextView) findViewById(R.id.my_zhanghu);
		tv_customer = (TextView) findViewById(R.id.enterprise_tel);
		tv_customer.setOnClickListener(this);
		my_zhanghu.setOnClickListener(this);
		img_back.setOnClickListener(this);
		tv_addmonry.setText("充值金额    "
				+ df.format(Double.parseDouble(getIntent().getStringExtra(
						"money"))) + "元");
		btn_again = (Button) findViewById(R.id.add_again);
		rl_back = (RelativeLayout) findViewById(R.id.rl_back);
		rl_back.setOnClickListener(this);
		btn_again.setOnClickListener(this);

	}

	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
		BbtApplication.getInstance().removeActvity(this);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.add_again:
			Intent intent2 = new Intent(Addmoneyfail.this,
					V4AddMoneySActiviy.class);
			startActivity(intent2);
			break;

		case R.id.img_back:
			finish();
			break;
		case R.id.rl_back:
			finish();
			break;
		case R.id.my_zhanghu:
			Intent mIntent = new Intent();
			mIntent.setAction("exit1");
			sendBroadcast(mIntent);
			finish();
			break;
		case R.id.enterprise_tel:
			BaseHelper.showDialog2(this, "拨号", "400-0101-016", 1);
			break;

		}
	}

}
